<?php
declare (strict_types = 1);
namespace app\api\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Sign extends Model
{
    protected $table='ea_sign';
    //查寻本周开始之后的签到记录
    public static function signRecord($user_id,$star_time)
    {
        return self::where('user_id','=',"$user_id")
                   ->where('create_time','>',$star_time)
                   ->order('create_time','asc')
                   ->select();
    }
    public static function signDetails($user_id,$star,$end){
        return self::where('user_id','=',"$user_id")
                   ->where('create_time','>',"$star")
                   ->where('create_time','<',"$end")
                   ->find();
    }
    public static function createSign($where)
    {
        return self::create($where);
    }
}
